<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title></title>
  <link rel="stylesheet" href="../layui/css/layui.css" media="all">
  <script type="text/javascript" src="../layui/layui.js"></script>
</head>

<body>
<img class="bgc" src="../layui/images/register.png" width="100%" alt="">
<form class="layui-form" action="">

  <div class="layui-form-item">
    <label class="layui-form-label">用户名id</label>
    <div class="layui-input-block">
      <input type="text" name="user_id" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">密码框</label>
    <div class="layui-input-inline">
      <input type="text" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
    </div>
    <div class="layui-form-mid layui-word-aux">请输入6-16位英文字符</div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">用户名</label>
    <div class="layui-input-block">
      <input type="text" name="name" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
    </div>
  </div>



  <div class="layui-form-item">
    <label class="layui-form-label">电话号码</label>
    <div class="layui-input-block">
      <input type="text" name="phone" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">邮件</label>
    <div class="layui-input-block">
      <input type="text" name="email" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
    </div>
  </div>






  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
</form>
<script type="text/javascript" src="../layui/layui.js"></script>
<script>

  layui.use(['form','jquery'], function() {
    var form = layui.form;
    window.jQuery = window.$ = layui.jquery;

    //监听提交
    form.on('submit(formDemo)', function (data) {

      layer.msg(JSON.stringify(data.field));
      $.post("http://localhost:8080/webDemo_war_exploded/UserAddServlet", data.field, function () {
        window.location.href = "./indexlaf.html";
      })
      return false;
    });
  });

</script>



</body>
</html>
